//
//  AssetRingView.m
//  ZZLC
//
//  Created by 杨春至 on 2018/1/3.
//  Copyright © 2018年 ZhongZeng. All rights reserved.
//

#import "AssetRingView.h"
#import "JHRingChart.h"

@interface AssetRingView ()
@property (nonatomic,strong) JHRingChart *chart;

@end

@implementation AssetRingView

- (instancetype)initWithFrame:(CGRect)frame{
    if ([super initWithFrame:frame]) {
        self.backgroundColor = RGBCOLOR(255, 255, 255);
        [self configSubViews];
    }
    return self;
}
- (void)configSubViews{
    [self addSubview:self.chart];

}

- (JHRingChart *)chart{
    if (!_chart) {
        _chart = [[JHRingChart alloc]initWithFrame:CGRectMake(0, 0, self.width, self.height)];
        _chart.backgroundColor = [UIColor whiteColor];
        _chart.centerX = self.centerX;
    }
    return _chart;
}
- (void)setDataSource:(NSArray *)dataSource{
    _dataSource = dataSource;
//    _chart.valueDataArr = @[@"1516",@"1564",@"1600"];
    _chart.valueDataArr = _dataSource;
    _chart.ringWidth = 50.0;
    _chart.fillColorArray = @[RGBCOLOR(253, 205, 90), RGBCOLOR(194, 237, 122),RGBCOLOR(130, 207, 242)];
    [_chart showAnimation];
}
@end
